<?php
/**
 * @File	  : Base_Controller.php
 * @Project	  : vncphathoc
 * @author	  : ThanhMinh
 * @email	  : thanhminhld@yahoo.com - thanhminhld@gmail.com
 * @copyright : 2009
 */

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Base_Controller extends Controller
{
	protected $lang_default = null;
	protected $lang_tag     = null;
	/**
	 * Base_Controller constructor init Smarty and get config
	 * @access public
	 *
	 */
	public function __construct()
	{
		parent::Controller();

		$langDefault         = $this->lang_model->getLangDefault();
		$this->lang_default  = $langDefault->id;
		$lang_tag            = array('lang_tag' => $langDefault->tag);
		$this->lang_tag      = $langDefault->tag;
		$this->session->set_userdata($lang_tag);

        $this->defaultCheck();
	}
	/**
	 * defaultCheck : check login admin
	 * and assign menu
	 * @access : public
	 */
	public function defaultCheck()
	{
		$this->users_model->hasLogin();
		// Assign menu
		$this->assignMenu();
	}
	/**
	 * assignMenu
	 * @access private
	 * @param
	 * @return
	 */
	private function assignMenu()
	{
		// introduction
		$this->msmarty->assign('modulesManage', 	   '?c=modules');
		// room
        $this->msmarty->assign('module_group_link',	   '?c=modulegroup');
        // Project
        $this->msmarty->assign('project_man_link', '?c=project');
        // Setting
        $this->msmarty->assign('setting_link',	   '?c=setting');
	}
}
?>